package com.asdhawaii.otello.util;

/**
 * Pauses program execution for a given duration of time.
 * 
 * @author Branden Ogata
 *
 */

public class Timer
{
  /**
   * Stops execution for the given number of milliseconds.
   * 
   * @param millis The long equal to the number of milliseconds to stop for.
   * 
   */
  
  public static void pauseForMillis(long millis)
  {
    long changedFrameTime = System.currentTimeMillis();
    long currentTime = System.currentTimeMillis();
    
    while (currentTime - changedFrameTime < millis)
    {
      currentTime = System.currentTimeMillis();
    }
  }
}
